package com.demo.entity;

import cn.lingyangwl.framework.mybatis.mate.annotations.FieldUnique;
import cn.lingyangwl.framework.mybatis.mate.annotations.FieldUniqueConfig;
import cn.lingyangwl.framework.mybatis.mate.enums.SqlConditionTypeEnum;
import cn.lingyangwl.framework.mybatis.mate.inter.EntityFieldUniqueCheck;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*;

/**
 * @author shenguangyang
 */
@Getter
@Setter
@Builder
@FieldUniqueConfig(sqlCondition = SqlConditionTypeEnum.OR)
@ToString
@TableName("sys_user")
@NoArgsConstructor
@AllArgsConstructor
public class SysUserPO implements EntityFieldUniqueCheck {
//    @TableId(value = "demo_id", type = IdType.AUTO)
//    private String demoId;

    // 如果使用了自定义主键类型, 不需要指定type
    @TableId(type = IdType.AUTO)
    private String id;

    @FieldUnique(message = "名字已存在")
    private String name;

//    @FieldUnique(message = "邮箱已存在")
    private String email;

    private Integer status;

    private int code;
}
